/-docs
/-editor
CodeMirrorEditor.ts
CompletionCodeMirrorEditor.ts
CssEditorType.ts
Editor.ts
EditorType.ts
HtmlEditorType.ts
JavaScriptEditorType.ts
TypeScriptEditorType.ts
x-last-PlainTextEditorType.ts
/-files
/-files-old
/-imports
/-layout
/-storage
/-tests ...
/-tests/files
/-tests/storage
TestCase.html
TestCase.ts
TestPage.css
TestPage.html
TestPage.ts
_sampleTests.ts
teapo-tests.html
teapo-tests.ts
/-typings
codemirror.d.ts
knockout.d.ts
typescriptServices.d.ts
websql.d.ts
zip.js.d.ts
TypeScriptService.ts
functions.ts
ko.ts
persistence.api.ts
persistence.ts
shell.ts
teapo.html
teapo.ts
x
    static forEachTest(namespace: any, callback: (name: string, _this_: any, test: () => void) => void) {
36
    }
37
38
    private _updateTimes() {
39
      if (this.running().length + this.notStarted().length === 0) {
40
        clearInterval(this._updateTimesInterval);
41
        this._updateTimesInterval = 0;
42
        return;
43
      }
44
45
      var now = Date.now();
46
      forEach(this.running(), t => t.updateTimes(now));
47
    }
48
49
    private _continueStarting() {
50
      var now = Date.now();
51
      forEach(this.running(), t => {
52
        t.updateTimes(now);
53
      });
54
      
55
      var nextRest = Date.now() + this.workQuantum;
56
      while (true) {
57
58
        if (!this.notStarted().length)
59
          return;
60
61
        this._startOne();
62
63
        if (!this.notStarted().length)
64
          return;
65
        
66
        if (Date.now() >= nextRest) {
67
          this._queueWorkItem(this._continueStartingClosure);
68
          return;
69
        }
70
      }
71
    }
72
73
    private _startOne() {
74
      var nextTest = this.notStarted.shift();
75
      this.running.push(nextTest);
76
77
      nextTest.start(() => {
78
79
        this.running.remove(nextTest);
80
81
        var newState = nextTest.state();
82
83
        var targetCollection =
84
          newState === TestCase.State.Succeeded ? this.succeeded :
85
          newState === TestCase.State.Failed ? this.failed :
86
          null;
87
88
        if (targetCollection) {
89
          var targetCollectionArray = targetCollection();
90
91
          // iterate backwards, as the tests are likely to complete in the order they started
92
          for (var i = targetCollectionArray.length - 1; i >= 0; i--) {
93
            var t = targetCollectionArray[i];
94
            if (nextTest.name > t.name) {
95
              targetCollection.splice(i + 1, 0, nextTest);
96
              return;
97
            }
98
          }
99
100
          targetCollection.unshift(nextTest);
101
        }
102
      });
103
    }
45:13 function (array: TestCase[], callback: (x: TestCase, index: number) => void): void